<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>查询用户</title>
    <link rel="stylesheet" type="text/css" th:href="@{/styles.css}">
</head>
<body>
<div class="container">
    <h2>查询用户</h2>
    <form action="/doQueryUser" method="get">
        <div class="form-group">
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" required>
        </div>
        <button type="submit">查询</button>
    </form>
    <div class="table-container" th:if="${users != null and not #lists.isEmpty(users)}">
        <table>
            <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user : ${users}">
                <td th:text="${user.id}"></td>
                <td th:text="${user.username}"></td>
            </tr>
            </tbody>
        </table>
    </div>
    <a href="/login" class="back-link">返回登录页</a>
</div>
</body>
</html>